
package DBLayer;
import ModelLayer.Order;
import java.util.ArrayList;

/**
 * @version 12/22/2011
 * @author Gruppe 4
 */

public interface IFDBOrder 
{
    /**
     * Method to get all orders for a specific person
     * @param personId int personId the id of the person we want to find the orders for
     * @param retrieveAssociation
     * @return returns an ArrayList with orders
     */
    public ArrayList<Order> findOrders(int personId, boolean retrieveAssociation);
    
    /**
     * Method to get all orders with a specific id, (used later in a listModel)
     * @param orderId int orderId the id of the order we want to find
     * @param retrieveAssociation
     * @return returns an ArrayList with orders
     */
    public ArrayList<Order> findOrdersByOrderId(int orderId, boolean retrieveAssociation);
    
    /**
     * Method that finds an order from the database with a specific orderId
     * @param orderId int orderId the id of the order we want to find
     * @return returns an Order object
     */
    public Order searchOrderId(int orderId, boolean retriveAssociation);
    
    /**
     * Method that finds an order from the database with a specific orderDate
     * @param orderDate String orderDate the date of the order
     * @return returns an ArrayList of Order objects
     */
    public ArrayList<Order> searchOrderDate(String orderDate, boolean retriveAssociation);
    
    /**
     * Method that inserts an order into the database
     * @param orderObj Order orderObj the Order wanted to set into the database
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int insertOrder(Order order) throws Exception;
    
    /**
     * Method that updates information about an order
     * Not yet implemented as prepared statement
     * @param order Order order the order wanted to update
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int updateOrder(Order orderId);
    
    /**
     * Method that deletes an order from the database
     * @param orderId int orderId the Id of the order wanted to be deleted
     * @return returns an int 1 if the method succedes and -1 if the method fails
     */
    public int deleteOrder(int orderId);
    
    /**
     * Method to get the highest orderId that excist in the database
     * @return returns the highest orderId
     */
    public int getMaxId();  
}
